package com.cbg.bus.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.cbg.base.utils.Result;
import com.cbg.bus.entity.Rider;
import com.cbg.bus.service.IRiderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.cbg.base.core.SuperController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chenbing
 * @since 2018-12-18
 */
@RestController
@RequestMapping("/bus/rider")
@Api(value = "乘车人控制器",tags = "乘车人操作接口")
public class RiderController extends SuperController<IRiderService, Rider> {
    @Autowired
    IRiderService riderService;

    @ApiOperation(value="获取已添加乘车人", notes="获取已添加乘车人")
    @GetMapping("/his")
    public Result<?> rider(){
        return Result.ok(riderService.list(new LambdaQueryWrapper<Rider>().eq(Rider::getUserId, userId())));
    }
}
